. $topsrcdir/browser/config/mozconfig

#this was on gentoo:
#www-client/firefox -gmp-autoupdate -gstreamer pulseaudio system-jpeg system-icu -system-libvpx system-sqlite -wifi -debug -egl -system-cairo -hwaccel jit
#TODO: not found yet: jit, egl, wifi(kinda) gmp-autoupdate hwaccel

#default: build Firefox
ac_add_options --enable-application=browser

#default:
ac_add_options --enable-optimize
#ac_add_options --enable-optimize=-O2

# https://developer.mozilla.org/en-US/docs/Configuring_Build_Options
#XXX: no debug from gentoo
#ac_add_options --disable-debug
#ac_add_options --disable-debug-symbols
#ac_add_options --enable-strip

ac_add_options --disable-strip
ac_add_options --enable-debug
ac_add_options --enable-debug-symbols
#^ these three don't seem to show me the symbols on core dump(which is handled by journalctl aka systemd)


#speed up? when compiling
#ac_add_options --disable-tests
ac_add_options --enable-tests

ac_add_options --disable-debug-js-modules
#^uncommented the above and recompilation(after placing the new mozconfig and touch configure) took only 9min, hooray! :)

#default:
#XXX: mozbuild.configure.options.InvalidOptionError: Unknown option: --enable-crypto
#ac_add_options --enable-crypto

ac_add_options --prefix=/usr
#XXX: 0:11.68 mozbuild.configure.options.InvalidOptionError: Unknown option: --libdir
#ac_add_options --libdir=/usr/lib

#ac_add_options --enable-official-branding
#^ idno why not, maybe PKGBUILD install() icons?

# System libraries
ac_add_options --with-system-nspr

#ac_add_options --with-system-nss  #nss>=3.26 !! have 3.25 now on Manjaro
ac_add_options --without-system-nss

#XXX: system-jpeg from gentoo
ac_add_options --with-system-jpeg
ac_add_options --with-system-zlib
ac_add_options --with-system-bz2
ac_add_options --with-system-png
ac_add_options --with-system-libevent

#XXX: not-system-libvpx from gentoo
#ac_add_options --without-system-libvpx
#chromium has system-libvpx:
ac_add_options --with-system-libvpx

ac_add_options --enable-system-hunspell
#XXX: system-sqlite from gentoo
ac_add_options --enable-system-sqlite
ac_add_options --enable-system-ffi

# Features
#ac_add_options --enable-startup-notification
#^ bad because #if defined(MOZ_ENABLE_STARTUP_NOTIFICATION)
# if (mIsX11Display) {
# in a static function, but that field is part of a class!
#so,  0:42.98 /home/z/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/widget/gtk/nsWindow.cpp:1352:9: error: ‘mIsX11Display’ was not declared in this scope


ac_add_options --disable-crashreporter
ac_add_options --disable-updater
# 0:11.46 mozbuild.configure.options.InvalidOptionError: Unknown option: --disable-installer
#ac_add_options --disable-installer


#extra security
#can't enable this because compiler errors:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/js/src/gdb/Unified_cpp_js_src_gdb0.i_o:Unified_cpp_js_src_gdb0.cpp:function Fragment_Root_barriers::run(JSContext*, char const**&): error: undefined reference to '__asan_poison_memory_region'
#ac_add_options --enable-address-sanitizer

#can't enable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/js/src/vm/Compression.cpp:112:32: error: ‘__msan_unpoison’ was not declared in this scope
#ac_add_options --enable-memory-sanitizer

#ac_add_options --disable-profiling
#ac_add_options --disable-systrace
#ac_add_options --disable-valgrind
#ac_add_options --disable-jprof
# 0:10.30 mozbuild.configure.options.InvalidOptionError: Unknown option: --disable-shark
#ac_add_options --disable-shark
#ac_add_options --disable-instruments
#ac_add_options --disable-callgrind
#ac_add_options --disable-vtune
#ac_add_options --disable-cpp-rtti
ac_add_options --enable-gold
#--with-pthreads
#ac_add_options --disable-dtrace
ac_add_options --with-x
#ac_add_options --disable-printing
#mozbuild.configure.options.InvalidOptionError: Unknown option: --disable-gnomevfs
#ac_add_options --disable-gnomevfs
#ac_add_options --disable-gio
#ac_add_options --disable-gconf
#ac_add_options --disable-libproxy
#ac_add_options --disable-gnomeui

#this is optional tho:14:10.76 Notification center failed: Install the python dbus module to get a notification when the build finishes.
#ac_add_options --disable-dbus #!!!!
#ac_add_options --enable-dbus #!!!!

#ac_add_options --disable-websms-backend
#ac_add_options --disable-dbm #!!!!
#ac_add_options --disable-accessibility

# 0:26.05 /home/z/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/dom/media/webrtc/MediaEngineCameraVideoSource.h:14:53: fatal error: webrtc/video_engine/include/vie_capture.h: No such file or directory
#ac_add_options --disable-webrtc
#ac_add_options --enable-webrtc


#can't disable this because compilation error
#WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::SpeechSynthesis'., /home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/dom/bindings/Window.webidl line 231:68
#ac_add_options --disable-webspeech

#ac_add_options --enable-raw
#ac_add_options --disable-raw

#can't disable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/content/media/ogg/OggWriter.h:10:30: fatal error: OpusTrackEncoder.h: No such file or directory
#ac_add_options --disable-opus
# 0:11.00 mozbuild.configure.options.InvalidOptionError: Unknown option: --enable-opus
#ac_add_options --enable-opus


#can't disable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/content/media/mediasource/ContainerParser.cpp:9:32: fatal error: WebMBufferedParser.h: No such file or directory
#ac_add_options --disable-webm
#ac_add_options --enable-webm
#mozbuild.configure.options.InvalidOptionError: Unknown option: --enable-webm



#ac_add_options --disable-directshow
#ac_add_options --disable-wmf
#ac_add_options --disable-ffmpeg
#ac_add_options --enable-ffmpeg
#ac_add_options --disable-fmp4
#XXX: mozbuild.configure.options.InvalidOptionError: '--enable-fmp4' implied by '--enable-ffmpeg' conflicts with '--disable-fmp4' from the mozconfig
#ac_add_options --enable-fmp4


#can't disable this or else compilation error:
#WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::MediaKeys'., /home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/dom/bindings/HTMLMediaElement.webidl line 150:21
#ac_add_options --disable-eme

#can't disable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/dom/bindings/NavigatorBinding.cpp:1204:9: error: ‘class mozilla::dom::Navigator’ has no member named ‘MozGetUserMediaDevices’
#ac_add_options --disable-media-navigator


#ac_add_options --disable-omx-plugin
#unknown option:
#ac_add_options --disable-wave

#ac_add_options --enable-alsa
#ac_add_options --disable-alsa


#ac_add_options --enable-pulseaudio
#ac_add_options --disable-pulseaudio

#ac_add_options --enable-gstreamer
#XXX: no gstreamer from gentoo
#ac_add_options --disable-gstreamer
#unknown option:
#ac_add_options --enable-gstreamer=1.0
#^ i dno about this! new PKGBUILD has it tho


#see ./configure --help | less
#ac_add_options --disable-system-extension-dirs
# https://mxr.mozilla.org/mozilla-central/source/extensions/
#ac_add_options --enable-extensions=default,-skipgnomevfs,-skipgio
#ac_add_options --disable-pref-extensions
#ac_add_options --disable-negotiateauth
#ac_add_options --disable-permissions
#ac_add_options --disable-universalchardet


#can't disable this because compilation error:
#WebIDL.WebIDLError: error: Unresolved type '<unresolved scope>::Gamepad'., /home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/obj-x86_64-unknown-linux-gnu/dom/bindings/Navigator.webidl line 272:11
#ac_add_options --disable-gamepad


#ac_add_options --disable-libjpeg-turbo
#ac_add_options --enable-tree-freetype
#ac_add_options --disable-webapp-runtime
ac_add_options --disable-maintenance-service
#ac_add_options --disable-bundled-fonts
#ac_add_options --disable-verify-mar
#ac_add_options --disable-signmar
#ac_add_options --disable-parental-controls
ac_add_options --enable-sandbox
ac_add_options --enable-content-sandbox

#Cannot build Firefox with --disable-feeds
#ac_add_options --disable-feeds

ac_add_options --enable-safe-browsing
#ac_add_options --disable-safe-browsing
#ac_add_options --enable-url-classifier


#can't disable this because compilation error:
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/startupcache/StartupCache.cpp:29:26: fatal error: nsIZipWriter.h: No such file or directory
#ac_add_options --disable-zipwriter


#ac_add_options --enable-faststripe
#ac_add_options --enable-mobile-optimize
#unknown option:
#ac_add_options --disable-logging
#ac_add_options --disable-logrefcnt
#ac_add_options --disable-dump-painting
#unknown option:
#ac_add_options --disable-trace-malloc

#ac_add_options --enable-dmd
#ac_add_options --enable-jemalloc

#ac_add_options --enable-trace-jscalls
#ac_add_options --disable-gcincremental
#ac_add_options --disable-gcgenerational
#ac_add_options --enable-gccompacting
#ac_add_options --enable-small-chunk-size
#ac_add_options --enable-gczeal
#ac_add_options --enable-install-strip

#not needed, unless it fails at some point
#ac_add_options --disable-elf-hack

#ac_add_options --disable-tasktracer
#unknown option:
#ac_add_options --disable-visual-event-tracer
#ac_add_options --disable-stdcxx-compat

ac_add_options --disable-startupcache
#or else:  0:08.52 /tmp/obj-x86_64-pc-linux-gnu/dist/bin/xpcshell: /usr/lib/firefox/libxul.so: version `xul51a1' not found (required by /tmp/obj-x86_64-pc-linux-gnu/dist/bin/xpcshell)


#ac_add_options --disable-b2g-ril
#ac_add_options --disable-b2g-bt
#ac_add_options --disable-nfc
#ac_add_options --disable-synth-pico
#ac_add_options --disable-b2g-camera

#says invalid option, odd:
#ac_add_options --jitreport-granularity=0

#ac_add_options --enable-xterm-updates

#can't disable this because compilation error
#/home/emacs/build/firefox-hg/makepkg/firefox-hg/src/firefox-hg/gfx/2d/convolver.h:38:26: fatal error: skia/SkTypes.h: No such file or directory
#ac_add_options --disable-skia

#ac_add_options --enable-system-cairo
#XXX: not-system-cairo from gentoo
#ac_add_options --disable-system-cairo
ac_add_options --enable-system-pixman

#//old: trying to avoid a compilation error XPIDL_MODULE cannot be defined unless there are XPIDL_SOURCES
# 2:12.39 /tmp/obj-x86_64-pc-linux-gnu/dist/include/nsStyleStruct.h:2641:12: error: ‘NS_STYLE_DISPLAY_INLINE_XUL_GRID’ was not declared in this scope
# 2:20.08 /home/z/build/1packages/firefox-hg/makepkg_pacman/firefox-hg/src/firefox-hg/layout/style/nsStyleStruct.h:2642:12: error: ‘NS_STYLE_DISPLAY_INLINE_STACK’ was not declared in this scope
#with this: ac_add_options --disable-xul
#ac_add_options --enable-xul #this is the default

#unknown option:
#ac_add_options --enable-profilelocking
#XXX: no wifi from gentoo
ac_add_options --disable-necko-wifi
#ac_add_options --disable-cookies

#ac_add_options --disable-ctypes

#XXX: system-icu from gentoo
ac_add_options --with-system-icu
#ac_add_options --without-intl-api


#tisdone: must update ccache or else -fprofile-generate  is not recognized and thus not ccached! >3.1.9  >=3.2.0 to be sure!

#FIXME: currently getting this error and don't know what causes it, doesn't seem to be these options, must be something else that changed because it worked ok before.
#configure: error: Your toolchain does not support C++0x/C++11 mode properly. Please upgrade your toolchain

# PGO
#commented out to prevent lockup when compiling:
#mk_add_options MOZ_PGO=1
#mk_add_options PROFILE_GEN_SCRIPT='EXTRA_TEST_ARGS=10 $(MAKE) -C $(MOZ_OBJDIR) pgo-profile-run'
# autoconf
mk_add_options AUTOCONF=autoconf-2.13

# tell firefox to use python2 because python points to python3 in arch
mk_add_options PYTHON=/usr/bin/python2

#this is actually auto selected to be right, but I wanna be sure, because I've seen only 3 cc1plus most of the time with 'top'
mk_add_options MOZ_MAKE_FLAGS="-j4"


#this seems useless! because if I delete MOZ_OBJDIR it will ccache miss everything basically; ok nevermind, it seems to work now - reran after successful compile and it does get hundreds of hits!
ac_add_options --with-ccache=/usr/bin/ccache


#src: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Configuring_Build_Options
mk_add_options MOZ_OBJDIR=/tmp/obj-@CONFIG_GUESS@

# vim:set ft=sh:
